/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author LYS
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../../model/baseModel';
import { UploadApiResult } from '../../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface CarddKpedKpmx extends BasicModel<CarddKpedKpmx> {
  kpmxFpbh?: string; // 发票编号
  kpmxKprq?: string; // 开票日期
  kpmxKpdw?: string; // 开票单位
  kpmxEdid?: string; // 额度ID
  kpmxJe?: number; // 金额
  kpmxSl?: number; // 税率
  kpmxBz?: string; // 备注
  syje?: number; // 剩余金额
}

export const carddKpedKpmxList = (params?: CarddKpedKpmx | any) =>
  defHttp.get<CarddKpedKpmx>({ url: adminPath + '/cardd/kped/carddKpedKpmx/list', params });

export const carddKpedKpmxListData = (params?: CarddKpedKpmx | any) =>
  defHttp.post<Page<CarddKpedKpmx>>({ url: adminPath + '/cardd/kped/carddKpedKpmx/listData', params });

export const carddKpedKpmxForm = (params?: CarddKpedKpmx | any) =>
  defHttp.get<CarddKpedKpmx>({ url: adminPath + '/cardd/kped/carddKpedKpmx/form', params });

export const carddKpedKpmxSave = (params?: any, data?: CarddKpedKpmx | any) =>
  defHttp.postJson<CarddKpedKpmx>({ url: adminPath + '/cardd/kped/carddKpedKpmx/save', params, data });

export const carddKpedKpmxImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/cardd/kped/carddKpedKpmx/importData',
      onUploadProgress,
    },
    params,
  );

export const carddKpedKpmxDelete = (params?: CarddKpedKpmx | any) =>
  defHttp.get<CarddKpedKpmx>({ url: adminPath + '/cardd/kped/carddKpedKpmx/delete', params });
